package org.hilo.boot.core.value;

import java.lang.reflect.Field;

import org.hilo.boot.core.UT;

/**
 * 
 * @author zollty
 * @since 2018-03-20
 */
public abstract class AbstractObjectInitValue implements ObjectInitValue {

    @Override
    public void initValue(final Object standardBean, final int type) {
        UT.Ref.doWithFields(standardBean.getClass(), new UT.Ref.FieldCallback() {
            @Override
            public void doWith(Field field) {
                initField(field, standardBean, type);
            }
        }, UT.Ref.COPYABLE_FIELDS);
    }
    
    protected abstract void initField(final Field field, final Object standardBean, final int type);

}
